import { getBehaviorList, exportBehaviorResource, showMsg } from '../../../vuex/action'

export default {
  data() {
    return {
      records: []
    }
  },
  vuex: {
    actions: {
      xGetList: getBehaviorList,
      xShowMsg: showMsg
    }
  },
  ready() {
    this.xGetList()
      .then((data) => {
        this.records = data.list
      })
      .catch((res) => {
        this.xShowMsg({
          type: 'danger',
          content: res.error_msg
        })
      })
  },
  methods: {
    exportTable() {
      var start = 0
      var limit = 365 * 10
      location.href = exportBehaviorResource + '?start=' + start + '&limit=' + limit
    }
  }
}
